﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Coding4Fun.Toolkit.Controls">
	
	<Style TargetType="local:SuperSlider">
		<Setter Property="Background" Value="{StaticResource DefaultChromeBrush}" />
		<Setter Property="Foreground" Value="{StaticResource DefaultAccentBrush}" />
		<Setter Property="Padding" Value="0, 3, 0, 36" />

		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:SuperSlider">
					<Grid Name="Body">
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition />
						</Grid.RowDefinitions>
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames
													Storyboard.TargetProperty="Fill" 
													Storyboard.TargetName="ProgressRectangle">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}"/>

										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames
													Storyboard.TargetProperty="Fill" 
													Storyboard.TargetName="BackgroundRectangle">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultChromeBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						
						<Grid Grid.Row="1">
							<Border Margin="{TemplateBinding Padding}">
								<Grid Name="BarBody">
									<Rectangle 
										Grid.Row="1"
										Name="BackgroundRectangle"
										Fill="{TemplateBinding Background}" />
									<Rectangle 
										Grid.Row="1"
										Name="ProgressRectangle"
										Fill="{TemplateBinding Foreground}" />

									<ContentPresenter
										Grid.Row="1"
										Content="{TemplateBinding Thumb}" />
								</Grid>
							</Border>
						</Grid>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>